<template>
  <div id="newtab">
    自定义tab页面newtab
    <el-button @click="jumpOptions">跳转背景页面</el-button>
  </div>
</template>

<script>
export default {
  name: '',
  mixins: [],
  props: {},
  components: {},
  data () {
    return {
    }
  },
  watch: {},
  computed: {},
  created () {},
  mounted () {},
  methods: {
    jumpOptions () {
      if (window.chrome && window.chrome.runtime) {
        if (window.chrome && window.chrome.runtime && window.chrome.runtime.openOptionsPage()) {
          window.chrome.runtime.openOptionsPage()
        } else {
          window.open(window.chrome.runtime.getURL('options.html'))
        }
      } else {
        this.$message.error('跳转失败', JSON.stringify(window.chrome.runtime))
      }
    }
  }
}
</script>

<style scoped lang="scss">

</style>
